import threading

value = 0

gLock = threading.Lock()

def add_value():
  global value
  for x in range(500000):
    value += 1
  print(value)

def main():
  for x in range(2):
    t = threading.Thread(target=add_value)
    t.start()

if __name__ == '__main__':
  main()